<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8" />
        <title>clearResourceTimings functionality of resource timing</title>
        <link rel="author" title="Intel" href="http://www.intel.com/" />
        <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
        <script src="/resources/testharness.js"></script>
        <script src="/resources/testharnessreport.js"></script>
        <script src="/webperf/tests/resources/webperftestharness.js"></script>
        <script>
            setup({ explicit_done: true });
            test_namespace();
            function onload_test()
            {
                if (!performance || !performance.getEntriesByType || !performance.clearResourceTimings)
                {
                    test_true(false, "Resource Timing and Performance Timeline interface required by this test are supported!");
                    done();
                    return;                    
                }
                test_equals(performance.getEntriesByType("resource").length, 3, 3 + " resource timing entries should be stored in this page!");
                performance.clearResourceTimings();
                test_equals(performance.getEntriesByType("resource").length, 0, "No resource timing entries should be stored after clearResourceTimings!");
                done();
            }
        </script>
    </head>
    <body onload="onload_test();">
        <h1>Description</h1>
        <p>This test validates the functionality of clearResourceTimings method in resource timing.</p>
        <div id="log"></div>
    </body>
</html>
